<?php
$this->breadcrumbs=array();

$this->sidebarTop = array(
    'label' => Yii::t('BackEnd', 'Support'),
    'link' => Yii::app()->createUrl("/support/admin/")
);

$this->moduleName = "Support";

$this->slidebar = Backend::getModuleSlideBar('Setting', '/support/admin');

$this->menu=array(
	array('label'=>Common::icon('delete'), 'itemOptions'=>array('style'=>'cursor:pointer', 'onclick'=>'Chienlv.deleteAll("form-admin", "/support/delete");')),
	array('label'=>Common::icon('create'), 'url'=>array('create')),
);

$this->title = Common::icon('manager'). Yii::t('BackEnd',"support");
?>

<div class="search-form">
    <?php $this->renderPartial('_search',array(
        'model'=>$model,
    )); ?>
<?php Yii::app()->clientScript->registerScript('search', "
        $('.search-button').click(function(){
            $('.search-form').toggle();
            return false;
        });
        $('.search-form form').submit(function(){
            $.fn.yiiGridView.update('support-grid', {
                data: $(this).serialize()
            });
            return false;
        });
    ");?>
</div><!-- search-form -->

<?php echo CHtml::beginForm('#', 'post', array('id'=>'form-admin', 'name'=>'frmAdmin')); ?><input type="hidden" id="moduleName" value="Support"/>
<?php $this->widget('application.widgets.admin.GridView', array(
	'id'=>'support-grid',
	'dataProvider'=>$model->search(),
	'columns'=>array(
		'id',
        array(
            'type' => 'raw',
            'name' => "full_name",
            'value' => $data->full_name,
            'htmlOptions' => array('style'=>'text-align:left;')
        ),
		'yahoo',
		'skype',
		'email',
		'phone',
        array(
            'name' => 'is_hot',
            'type' => 'raw',
            'value' => 'Lvc::htmlHot($data)',
            'htmlOptions' => array('style'=>'text-align:center;width:50px;')
        ),
        array(
            'type'=>'raw',
            'value'=>'CHtml::hiddenField("ids[]", $data->id, array("id"=>"item-".$data->id)).CHtml::textField("sorder[]", $data->sorder, array("id"=>"sorder-".$data->id, "size"=>"4", "class"=>"numbersOnly"));',
            'name'=>'sorder',
            'header'=>Yii::t('BackEnd', 'Sort order').' '.CHtml::image(Yii::app()->request->baseUrl.'/css/admin/images/save.png', 'icon-save', array('style'=>'vertical-align: middle;cursor:pointer;', 'onclick'=>'javascript: $(this).parent().click(function(){return false;});document.frmAdmin.submit();return false;')),
            'htmlOptions'=>array('style'=>'text-align:center'),
        ),
        array(
            'name' => 'status',
            'header' => Yii::t('BackEnd', 'Status'),
            'type' => 'raw',
            'value' => '($data->status == Lvc::STATUS_ENABLED)?CHtml::image(Yii::app()->request->baseUrl."/css/admin/images/tick.png", "enabled", array("class"=>"icon-status", "name"=>$data->id)):CHtml::image(Yii::app()->request->baseUrl."/css/admin/images/publish_x.png", "disabled", array("class"=>"icon-status", "name"=>$data->id))',
            'htmlOptions' => array('style'=>'text-align: center;'),
        ),
		array(
			'class'=>'CButtonColumn',
			'deleteConfirmation'=>Yii::t('BackEnd', 'Are you sure you want to delete this item?'),
		),
	),
)); ?>
<?php echo CHtml::endForm(); ?>